/*
 * SwSPI.hpp
 *
 *  Created on: 10.1.2013
 *      Author: lukas
 */

#ifndef SWSPI_HPP_
#define SWSPI_HPP_

void  ToBin ( int number, int* numberBin );
int  BinTo (int* numberBin);
int SwSpiInit(void);
void SwSpiRW(int ChSelect, int* buffer, int PocetSlov);

#define SPICLK 1
#define CS_SPI0 1
#define CS_SPI1 1
#define MOSI 1
#define MISO 1

#define NUM_PINS        17

#define WPI_MODE_PINS            0
#define WPI_MODE_GPIO            1
#define WPI_MODE_GPIO_SYS        2
#define WPI_MODE_PIFACE          3

#define INPUT            0
#define OUTPUT           1
#define PWM_OUTPUT       2

#define LOW              0
#define HIGH             1

#define PUD_OFF          0
#define PUD_DOWN         1
#define PUD_UP           2

#define SPIT2 36
#define SPIT1 SPIT2
#define SPIT3 SPIT2
#define SPIT7 2*SPIT2

#endif /* SWSPI_HPP_ */
